component persistent="true" accessors="true" {
    property name="id" generator="native" ormtype="integer" ; 
    property name="subject" ormtype="string" length="200";
    property name="pic" ormtype="string" length="200";
    property name="author" ormtype="string" length="20";
    property name="source" ormtype="string" length="200";
    property name="brief" ormtype="text" length="0";
    property name="keywords" ormtype="string" length="200";
    property name="content" ormtype="text" length="0";
    property name="ispublish" ormtype="integer" default="0"  length="1";
    property name="iscommend" ormtype="integer" default="0"  length="1";
    property name="iscomment" ormtype="integer" default="0"  length="1";
	property name="isscroll" ormtype="integer" default="0"  length="1";
	property name="haspoll" ormtype="integer" default="0"  length="1";
	property name="hits" ormtype="integer" default="0"  length="1";
    property name="seq" ormtype="integer" default="0"  length="11";
    
    property name="created" ormtype="timestamp";
    property name="edited" ormtype="timestamp";

	//通过articlebaseid来进行层级关系处理，利用该方式可实现章节的方式
	property name="children" fieldType="one-to-many" cfc="articlebase" fkcolumn="articlebaseid" cascade="delete-orphan" ;
	//获取信息所属分类内容
	property name="category" fieldtype="many-to-one" fkcolumn="categoryid" cfc="category";
	//通过articleextend实体类，来进行扩展字段的关联
	property  name="articleextend" fieldtype="one-to-many" cfc="articleextend" cascade="delete-orphan" fkcolumn="articlebaseid";
	//通过articlecomment实体类，来进行扩展字段的关联
	property  name="articlecomment" fieldtype="one-to-many" cfc="articlecomment" cascade="delete-orphan" fkcolumn="articlebaseid";
	
	public numeric function getCategoryID(){
		return getCategory().getId();
	}
	
	public string function getCategoryText(){
		return getCategory().getText();
	}
	
	public numeric function getCommentCounts(){
		var totalhql = "select count(id) as total from articlecomment where articlebaseid=#getId()#";
		var result["total"] = ormExecuteQuery(totalhql,true);
		return result["total"];
	}
	
}
